Skip to content

Comments

fix: FeatureTestTrait::withRoutes() may throw all sorts of errors on invalid HTTP methods#10004

Merged
paulbalandan merged 2 commits intocodeigniter4:developfrom
paulbalandan:fix-featuretesttrait-withroutes
Feb 25, 2026
Merged

fix: FeatureTestTrait::withRoutes() may throw all sorts of errors on invalid HTTP methods#10004
paulbalandan merged 2 commits intocodeigniter4:developfrom
paulbalandan:fix-featuretesttrait-withroutes

Conversation

@paulbalandan
Copy link
Member

Description
Per documentation, withRoutes() accepts a list of 3 to 4 element arrays where the first element is the HTTP verb (or the special add to mean all verbs). However, there's no validation for invalid methods and is just directly called upon RouteCollection which may result in unknown method, TypeError for parameter, etc.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@paulbalandan paulbalandan added the bug Verified issues on the current code behavior or pull requests that will fix them label Feb 24, 2026
@paulbalandan
Copy link
Member Author

Installing ImageMagick on PHP 8.4 is taking too long. 🤔

@paulbalandan paulbalandan merged commit eb6ac9f into codeigniter4:develop Feb 25, 2026
50 checks passed
@paulbalandan paulbalandan deleted the fix-featuretesttrait-withroutes branch February 25, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants